package com.msb.test07;

public class Person {
    private int age;
    private String name;
    private double height;
    //为什么私密呢，不想让所有类都能访问到，但是子类也访问不到了

    //通过公共方法访问

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
    public void eat(){
        System.out.println("人类也会吃饭");
    }
    public void sleep(){
        System.out.println("人类也会睡觉");
    }
}
